package com.youthburin.rmp.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import com.youthburin.base.domain.BaseVO;

/**
 * The persistent class for the rmp_role database table.
 * 
 */
@Entity
@Table(name = "rmp_role")
public class RmpRole extends BaseVO implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String code;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_TIME")
	private Date createTime;

	private String creater;

	private String name;

	private String remark;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UPDATE_TIME")
	private Date updateTime;

	private String updater;

	// uni-directional many-to-many association to RmpPermission
	@ManyToMany
	@JoinTable(name = "rmp_role_permission", joinColumns = { @JoinColumn(name = "ROLE_CODE") }, inverseJoinColumns = { @JoinColumn(name = "PERMISSION_CODE") })
	private Set<RmpPermission> rmpPermissions;

	// bi-directional many-to-many association to RmpUser
	@ManyToMany
	@JoinTable(name = "rmp_user_role", joinColumns = { @JoinColumn(name = "ROLE_CODE") }, inverseJoinColumns = { @JoinColumn(name = "USER_CODE") })
	private Set<RmpUser> rmpUsers;

	@Transient
	private List<RmpPermissionGroup> rmpPermssionsGroups;
	@Transient
	private List<RmpUser> allUsers;

	public RmpRole() {
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCreater() {
		return this.creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getUpdater() {
		return this.updater;
	}

	public void setUpdater(String updater) {
		this.updater = updater;
	}

	public Set<RmpPermission> getRmpPermissions() {
		return this.rmpPermissions;
	}

	public void setRmpPermissions(Set<RmpPermission> rmpPermissions) {
		this.rmpPermissions = rmpPermissions;
	}

	public Set<RmpUser> getRmpUsers() {
		return this.rmpUsers;
	}

	public void setRmpUsers(Set<RmpUser> rmpUsers) {
		this.rmpUsers = rmpUsers;
	}

	public List<RmpPermissionGroup> getRmpPermssionsGroups() {
		return rmpPermssionsGroups;
	}

	public void setRmpPermssionsGroups(List<RmpPermissionGroup> rmpPermssionsGroups) {
		this.rmpPermssionsGroups = rmpPermssionsGroups;
	}

	public List<RmpUser> getAllUsers() {
		return allUsers;
	}

	public void setAllUsers(List<RmpUser> allUsers) {
		this.allUsers = allUsers;
	}

}